home *** CD-ROM | disk | FTP | other *** search
/ Shareware Grab Bag / Shareware Grab Bag.iso / 001 / pibt40s1.arc / CAPTUREC.MOD < prev    next >
Text File  |  1987-03-11  |  2KB  |  52 lines

  1. (*----------------------------------------------------------------------*)
  2. (*          Capture_Char -- write character to capture file             *)
  3. (*----------------------------------------------------------------------*)
  4.  
  5. PROCEDURE Capture_Char( Ch : CHAR );
  6.  
  7. (*----------------------------------------------------------------------*)
  8. (*                                                                      *)
  9. (*     Procedure:  Capture_Char                                         *)
  10. (*                                                                      *)
  11. (*     Purpose:    Writes character to capture file                     *)
  12. (*                                                                      *)
  13. (*     Calling Sequence:                                                *)
  14. (*                                                                      *)
  15. (*        Capture_Char( Ch : CHAR );                                    *)
  16. (*                                                                      *)
  17. (*           Ch --- the character to be written out                     *)
  18. (*                                                                      *)
  19. (*     Remarks:                                                         *)
  20. (*                                                                      *)
  21. (*        If Exact_Capture is TRUE, then characters are written just    *)
  22. (*        as they are received.  If Exact_Capture is FALSE, then        *)
  23. (*        a full screen image line is gathered up and written when      *)
  24. (*        an LF or FF is encountered.                                   *)
  25. (*                                                                      *)
  26. (*----------------------------------------------------------------------*)
  27.  
  28. VAR
  29.    Screen_Line : AnyStr;
  30.    IY          : INTEGER;
  31.  
  32. BEGIN (* Capture_Char *)
  33.  
  34.    IF Exact_Capture THEN
  35.       IF ( Ch = CHR( LF ) ) THEN
  36.          WRITELN( Capture_File )
  37.       ELSE
  38.          WRITE( Capture_File , Ch )
  39.    ELSE
  40.       BEGIN
  41.          IF ( ( Ch = CHR( LF ) ) OR ( Ch = CHR( FF ) ) ) THEN
  42.             BEGIN
  43.                IY := WhereY;
  44.                Get_Screen_Text_Line( Screen_Line , IY, 1 );
  45.                WRITELN( Capture_File , TRIM( Screen_Line ) );
  46.             END;
  47.          IF ( Ch = CHR( FF ) ) THEN
  48.             WRITE( Capture_File , Ch );
  49.       END;
  50.  
  51. END   (* Capture_Char *);
  52.